Add option to display commit author identity with git config source#112
Conversation
Show the resolved user.name and user.email above the commit summary field along with tooltips indicating which git config file each value comes from (global, includeIf, local). The feature is controlled by a toggle in Preferences > Appearance and is disabled by default.
|
All done!) Here's the applied changes based on your feedback. Some implementation details came up along the way, but I made sure the default behavior remains unchanged for existing users. Detailed breakdown: 1. Moved the checkbox to Preferences -> Git -> Author tab1.1. Move "show identity"Moved the "show identity" checkbox from Appearance to the Git tab as requested. 1.2. Global config tab save problemWhile working on this, I discovered a side effect: clicking Save on the Git tab would write user.name and user.email to the global config even if they weren't set there originally. This is a problem for users who rely on includeIf directives - the global values would override the conditionally included identity. To address this, I added a "Store author identity in global Git config" checkbox that reflects the current state of the global config:
1.3. Link to infoAdded a link to the https://git-scm.com/docs/git-config#SCOPES below the display checkbox, since this tab was previously only about global settings and the scope concept may not be obvious to all users. 1.4. Add headersAdded section headings ("Global Author" / "Commit Identity Display") to the Author tab - without them the two unrelated settings appeared visually connected.
2. Repository settings - Git Config page2.1) Changed the "Resolved effective identity" text from secondary (muted) color to default, so it no longer looks disabled.
3. Tooltip3.1) Renamed 'Source' label to 'Scope' in tooltips to match official Git terminology
|
|
Everything looks good, thank you! :) |
|
This is now available in v3.5.7 |














I was about to leave GitHub Desktop because it doesn't support multiple accounts — but then I found this fork, and it's exactly what I needed. Thank you for maintaining it!
Problem source
However, one thing was missing for my workflow: I work with two different GitHub accounts (personal and work), and I use
includeIfin my git config to automatically switchuser.nameanduser.emaildepending on the project directory. Several times I accidentally pushed commits to personal projects under my work identity — simply because there was no visible indication of which credentials would be used.The avatar alone isn't always enough to tell accounts apart - not everyone has a distinct avatar set up, and the name/email are what actually end up in the commit. And if such a commit makes it into the repository, removing the committer from the contributors list on the main page is practically impossible — the only way is to delete the repository entirely.
My setup example
I don't set
user.name/user.emailin my global~/.gitconfigat all. Instead, I useincludeIfto load different identities based on the project directory:Each included file sets its own
user.nameanduser.email. Without this feature, there was no way to tell which identity GitHub Desktop would use for the next commit.Description
This PR displays the resolved
user.nameanduser.emailabove the commit summary field, along with tooltips indicating which git config file each value comes from (global, includeIf, local). The feature is controlled by a toggle inPreferences > Git > Authorand isdisabledby default.This PR adds an optional setting (
Preferences > Git > Author> "Show effective identity and config scope above commit message") that:user.nameanduser.emailnext to itglobal(standard~/.gitconfig)global, via [includeIf](conditionally included file)local(.git/config)The setting is disabled by default, so existing users won't notice any changes unless they opt in. I tried to keep the diff minimal and follow the existing code patterns.
Screenshots
Before change - avatar inline with title, without name and email

Added setting in Preferences -> Git -> Author (disabled by default):

After enabling — avatar, name, and email are always visible above the summary:

Scopes
1. Simple global
Hovering over the details reveals the exact config file. This is how a simple global config is detected:

2. includeIf
Notice how it correctly resolves and displays conditional global configs applied via

includeIf.3. Local
Example with local repository overrides: the tooltip accurately reflects when the credentials are being pulled from the local .git/config file instead of the global settings.

4. System
Repo config
Repository settings also show the resolved identity with clickable file paths - useful when an includeIf directive applies, since the form fields may not reflect the actual effective values.

Release notes
Notes: Adds optional display of commit author name, email, and their git config source above the summary field (Preferences -> Git -> Author).